﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GoogleMapUserControl.ascx.cs" Inherits="WandaSolution.GoogleMap.GoogleMapUserControl" %>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
    function mapinit() {

        var maparea = document.getElementById('<%=map_canvas.ClientID %>');
        var positionlat = maparea.getAttribute("lat");
        var positionlng = maparea.getAttribute("lng");
        var floatpositionlat = parseFloat(positionlat, 10);
        var floatpositionlng = parseFloat(positionlng, 10);

        var mapzoom = maparea.getAttribute("zoomlevel");
        var intmapzoom = parseInt(mapzoom, 10);

        var cslatlng = new google.maps.LatLng(floatpositionlat, floatpositionlng);

        var mapOptions = {
            zoom: intmapzoom,
            center: cslatlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(maparea, mapOptions);

        var marker = new google.maps.Marker({
            position: cslatlng,
            map: map,
            title: "万达酒店"
        });

    }

    $(function () {
        mapinit();
    });
</script>


<div id="map_canvas" runat="server" lat="" lng="" zoomlevel=""></div>